<template>
  <el-select filterable value-key="id" placeholder="请选择供应商">
    <el-option v-for="item in supplierList" :key="item.id" :value="isObject ? item : item.id"
      :label="item.name"></el-option>
  </el-select>
</template>

<script setup>
import { supplierServer } from '@/api'
import { ref } from 'vue';
defineProps({
  isObject: Boolean,
});
const supplierList = ref([]);
const getSupplierList = async () => {
  const { data } = await supplierServer.get({
    page_num: 1,
    size: 999
  });
  supplierList.value = data?.data_list || [];
};
getSupplierList();
</script>